
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>


int main(int argc, char **argv)
{
	int fd;
	unsigned char keyval;
	
	fd = open("/dev/third_drv", O_RDWR);
	if(fd < 0)
	{
		printf("Can't open third_drv!\n\r");
		return -1;
	}

	while(1)
	{
		read(fd, &keyval, 1);
		printf("keyval = 0x%x", keyval);
	}
	return 0;
}



